<?php

	class CoreDevSystemFileCSV extends CoreSystemFileCSV
	{

		/**
		 *  Get the next record from the CSV file
		 *  @name    next
		 *  @type    method
		 *  @access  public
		 *  @param   int    length    [optional, default 4096]
		 *  @param   string delimiter [optional, default class property 'delimiter' (default ',')]
		 *  @param   string enclosure [optional, default class property 'enclosure' (default '"')]
		 *  @returns mixed  object (if fieldnames are known), array (if fieldnames are not known)
		 *  @syntax  mixed [object]->next( mixed data [, string delimiter [, string enclosure ] ] );
		 */
		public function next( $nLength=4096, $sDelimiter=null, $sEncosure=null )
		{
			if ( empty( $sDelimiter ) )
				$sDelimiter = $this->delimiter;
			if ( empty( $sEnclosure ) )
				$sEnclosure = $this->enclosure;

			if ( $this->_fieldname === true )
				$this->_fieldname = $this->get( $nLength, $sDelimiter, $sEnclosure );

			$aResult = $this->get( $nLength, $sDelimiter, $sEnclosure );
			if ( $aResult !== false )
			{
				if ( is_array( $this->_fieldname ) )
				{
					$oReturn = (object) null;
					for ( $i = 0; $i < count( $this->_fieldname ); ++$i )
						$oReturn->{$this->_fieldname[ $i ]} = $aResult[ $i ];
					return $oReturn;
				}
				return $aResult;
			}
			return false;
		}
	}

?>